import { App, Plugin } from 'vue'
import type { IconProps } from './src/icon'
import Icon from './src/Icon'
import SvgIconProvider from './src/SvgIconProvider'
import IconSelect from './src/IconSelect'

export type { IconProps }

Icon.SvgIconProvider = SvgIconProvider
Icon.IconSelect = IconSelect
Icon.install = (app: App) => {
  app.component(Icon.name, Icon)
  app.component(SvgIconProvider.name, SvgIconProvider)
  app.component(IconSelect.name, IconSelect)
  return app
}

export default Icon as typeof Icon &
  Plugin & {
    readonly SvgIconProvider: typeof SvgIconProvider
    readonly IconSelect: typeof IconSelect
  }
